<template>
	<view class="main">
		<view class="vip">
			<view class="item" v-for="item in vipListData" @click="vipDetail(item)">
				<view class="title">
					{{item.name}}
				</view>
				<view class="text">
					购买时间期限为<br /> {{item.intro}}

				</view>
				<view class="text">
					{{item.comment}}
				</view>
				<view class="price">
					￥{{item.money}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		vipList
	} from "@/api/index.js"
	export default {
		data() {
			return {
				vipListData: []
			};
		},
		mounted() {
			vipList().then(res => {
				this.vipListData = res.data
			})
		},
		methods: {
			vipDetail(item) {
				uni.navigateTo({
					url: "/pages/mall/mall?item=" + JSON.stringify(item)
				})
			}
		}
	}
</script>

<style lang="scss">
	.main {
		.vip {

			padding: 40rpx;
			display: flex;
			background-color: #fff;
			margin-bottom: 20rpx;
			align-items: center;
			flex-wrap: wrap;

			.item {
				width: calc(50% - 20rpx);
				background-color: #DF9F45;
				padding: 20rpx 40rpx;
				color: #fff;
				margin-bottom: 60rpx;
				border-radius: 20rpx;
				text-align: center;
				position: relative;
				padding-bottom: 60rpx;

				.title {
					font-weight: 600;
					font-size: 32rpx;
					margin-bottom: 20rpx;
				}

				.text {
					margin-bottom: 20rpx;
				}

				.price {
					font-weight: 500;
					font-size: 30rpx;
					background: #fff;
					color: #EE8745;
					text-align: center;
					border-radius: 10rpx;
					width: 150rpx;
					height: 60rpx;
					line-height: 60rpx;
					box-sizing: border-box;
					box-shadow: 0rpx 0rpx 10rpx 6rpx #EE8745;
					position: absolute;
					bottom: -30rpx;
					left: 50%;
					margin-left: -75rpx;
				}
			}

			.item:nth-child(2n) {
				margin-left: 40rpx;
			}


		}
	}
</style>